package com.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TMajor entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_major", schema = "")
public class TMajor implements java.io.Serializable {

	// Fields

	private String majorId;
	private TCollege TCollege;
	private String id;
	private String majorName;
	private String isEnable;
	private Set<TClass> TClasses = new HashSet<TClass>(0);

	// Constructors

	/** default constructor */
	public TMajor() {
	}

	/** minimal constructor */
	public TMajor(String majorId) {
		this.majorId = majorId;
	}

	/** full constructor */
	public TMajor(String majorId, TCollege TCollege, String id, String majorName, String isEnable, Set<TClass> TClasses) {
		this.majorId = majorId;
		this.TCollege = TCollege;
		this.id = id;
		this.majorName = majorName;
		this.isEnable = isEnable;
		this.TClasses = TClasses;
	}

	// Property accessors
	@Column(name = "majorID", unique = true, nullable = false)
	public String getMajorId() {
		return this.majorId;
	}

	public void setMajorId(String majorId) {
		this.majorId = majorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "collegeID")
	public TCollege getTCollege() {
		return this.TCollege;
	}

	public void setTCollege(TCollege TCollege) {
		this.TCollege = TCollege;
	}
	@Id
	@Column(name = "id")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "majorName")
	public String getMajorName() {
		return this.majorName;
	}

	public void setMajorName(String majorName) {
		this.majorName = majorName;
	}

	@Column(name = "isEnable")
	public String getIsEnable() {
		return this.isEnable;
	}

	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMajor")
	public Set<TClass> getTClasses() {
		return this.TClasses;
	}

	public void setTClasses(Set<TClass> TClasses) {
		this.TClasses = TClasses;
	}

}